package com.zhtools.excel;

public class Column {
    private int index;
    private String name;
    private String field;
    private String defaultValue;
    private TypeHandler<?> typeHandler;
    private Formater<?> formater;

    public Column(String name, String field, String defaultValue) {
        this.name = name;
        this.field = field;
        this.defaultValue = defaultValue;
    }

    public Column(String name, String field, String defaultValue, Formater<?> formater) {
        this.name = name;
        this.field = field;
        this.defaultValue = defaultValue;
        this.formater = formater;
    }

    public Column(int index, String field) {
        this.index = index;
        this.field = field;
    }

    public Column(int index, String field, TypeHandler<?> typeHandler) {
        this.index = index;
        this.field = field;
        this.typeHandler = typeHandler;
    }

    public int getIndex() {
        return index;
    }

    public String getName() {
        return name;
    }

    public String getField() {
        return field;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public TypeHandler<?> getTypeHandler() {
        return typeHandler;
    }

    public Formater<?> getFormater() {
        return formater;
    }

    public String geterMethodName(){
        String geterMethodName = "get"
                + field.substring(0, 1).toUpperCase()
                + field.substring(1, field.length());
        return geterMethodName;
    }

    public String seterMethodName() {
        String methodName = "set"
                + field.substring(0, 1).toUpperCase()
                + field.substring(1, field.length());
        return methodName;
    }
}
